package cn.ffcs.security.dao;

import java.util.List;

import cn.ffcs.base.dao.BaseDAO;
import cn.ffcs.base.dao.ExtBaseDAO;
import cn.ffcs.bpm.model.ProcessConfigDetail;
import cn.ffcs.security.model.User;

/**
 * 
 * USER DAO 实现类<br/> <table>
 * <tr>
 * <td>负责人/principal: </td>
 * <td colspan="2">liuzhh</td>
 * <tr>
 * <td>修改记录/revision:</td>
 * <td colspan="2"></td>
 * </tr>
 * <tr>
 * <td>日期:</td>
 * <td>修改人:</td>
 * <td>修改说明:</td>
 * </tr>
 * <tr>
 * <td></td>
 * <td></td>
 * <td></td>
 * </tr>
 * </table>
 * @author liuzhh 
 * @version $Id$ 
 */
public class UserDAO<U 
extends User>extends ExtBaseDAO<U> implements IUserDAO<U> {
    /**
     * 获取用户实体类
     * @param b
     * @return
     */
    public String getEntityName(){
        return new User().getClass().getName();
    }
    /**
     * 通过personId取user
     * @param personID
     * @return
     */
    @SuppressWarnings("unchecked")
	public User getUser(String personID){
    	String sql=" from User t where t.personID='"+personID+"'";
    	List<User> list=null;
    	list=getHibernateTemplate().find(sql);
    	if(list.size()!=0){
    		return list.get(0);
    	}else {
    		return null;
    	}
    }
}


